#define _CRT_SECURE_NO_WARNINGS 1
#include"List.h"
void TestPSB(ListNode* plist)
{
	ListNodePushBack(plist, 1);
	ListNodePushBack(plist, 2);
	ListNodePushBack(plist, 3);
	ListNodePushBack(plist, 4);
	//ListNodePrint(plist);
}
void TestPSF(ListNode* plist)
{
	ListNodePushFront(plist, 1);
	ListNodePushFront(plist, 2);
	ListNodePushFront(plist, 3);
	ListNodePushFront(plist, 4);
	//ListNodePrint(plist);
}
void TestPPB(ListNode* plist)
{
	ListNodePopBack(plist);
	ListNodePopBack(plist);
	//ListNodePrint(plist);
}
void TestPPF(ListNode* plist)
{
	ListNodePopFront(plist);
	ListNodePopFront(plist);
	//ListNodePrint(plist);
}
void TestINS(ListNode* plist)
{
	ListNodeInsert(plist, plist->next, 0);
	ListNodeInsert(plist, plist->prev, 0);
	//ListNodePrint(plist);
}
void TestERA(ListNode* plist)
{
	ListNodeErase(plist, plist->next);
	ListNodeErase(plist, plist->next);
	ListNode* newnode = ListNodeFind(plist, 2);
	if (newnode)
	{
		ListNodeErase(plist, newnode);
	}
	ListNodePrint(plist);
	ListNodeDestory(plist);
}
int main()
{
	ListNode* plist = InitListNode();
	TestPSB(plist);
	TestPSF(plist);
	TestPPB(plist);
	TestPPF(plist);
	TestINS(plist);
	TestERA(plist);
	return 0;
}